package com.engine4cloud.tdf.education.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.engine4cloud.tdf.common.core.constant.enums.EducationProgressTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.engine4cloud.tdf.common.core.util.TenantTable;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 课程
 *
 * @author wenjie
 * @date 2024-07-30 14:56:55
 */
@Data
@TenantTable
@TableName("edu_course")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "课程")
public class EduCourseEntity extends Model<EduCourseEntity> {

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private Long id;

    /**
     * 课程编号
     */
    @Schema(description = "课程编号")
    private String code;

    /**
     * 课程名称
     */
    @Schema(description = "课程名称")
    private String name;

    /**
     * 是否必修
     */
    @Schema(description = "是否必修")
    private String isRequired;

    /**
     * 课时
     */
    @Schema(description = "课时")
    private BigDecimal periods;

    /**
     * 课程开始时间
     */
    @Schema(description = "课程开始时间")
    private LocalDateTime startTime;

    /**
     * 课程结束时间
     */
    @Schema(description = "课程结束时间")
    private LocalDateTime endTime;

    /**
     * 授课类型
     */
    @Schema(description = "授课类型")
    private EducationProgressTypeEnum progressType;

    /**
     * 教育形式
     */
    @Schema(description = "教育形式")
    private String format;

    /**
     * 封面地址
     */
    @Schema(description = "封面地址")
    private String coverUrl;

    /**
     * 课程描述
     */
    @Schema(description = "课程描述")
    private String describe;

    /**
     * 是否发布
     */
    @Schema(description = "是否发布")
    private String isPublish;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建人")
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新人")
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 删除状态
     */
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "删除状态")
    private String delFlag;

    /**
     * 租户id
     */
    @Schema(description = "租户id")
    private Long tenantId;
}